package com.gem.mapper;


import com.gem.domain.ClassInfo;
import com.gem.domain.ClassInfoAPI;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ClassInfoMapper {

    //持久层查询所有班级
    @Select("select * from classinfo where statu > 0")
    List<ClassInfo> findAll();

    //搜索班级
    List<ClassInfo> searchClassInfo(ClassInfo ClassInfo);

    //伪删除班级
    @Update("update classinfo set statu = -1 where id = #{classId}")
    boolean deleteById(Integer classId);

    //保存班级
    boolean save(ClassInfoAPI ClassInfo);

    //更新班级
    boolean update(ClassInfoAPI ClassInfo);

    //根据id查班级
    @Select("select * from classinfo where id = #{id}")
    ClassInfo findById(int id);
}
